# for循环语句
# result = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
# print(result)

# 语法格式
# for variabe in sequence:
#     do something
# else:
#     do something


# 统计1加到100的值
# result = 0
# for i in range(101):
#     result += i
# else:
#     print("i的值大于100了，现在i的值是：", i + 1)
# print(result)


# print("-------------------------")

# 计算1到100内所有偶数之和
result = 0
for i in range(101):
    if i % 2 == 0:
        result += i
print("1到100内所有偶数之和为：", result)
